package controller

import (
	"ay-activity/bus"
	"ay-activity/models/rename"
	"ay-activity/utils"
	"github.com/gin-gonic/gin"
)

type FileController struct {
	bathFileService bus.FileRenameService
}

func (fc FileController) ReName(c *gin.Context) {
	var req rename.RenameReq
	err := c.ShouldBindJSON(&req)
	if err != nil {
		c.JSON(500, err)
		return
	}
	i := fc.bathFileService.Rename(req)
	c.JSON(200, utils.JSONData(i))
}
